import { UIBase } from "../framework/UIBase";

const {ccclass, property} = cc._decorator;

@ccclass
export default class Toast extends UIBase {

    @property(cc.Label)
    msg: cc.Label = null;

    onShow(msg) {
        this.msg.string = msg;

        let delay = cc.delayTime(1);
        let func = cc.callFunc(this.hide.bind(this), this);
        let seq = cc.sequence(delay,func);
        this.node.runAction(seq);
    }

    onHide() {
    }
}
